package com.ellwood.IPGuard.common.core.exception;

import com.ellwood.IPGuard.common.core.enums.HttpCodeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
 * @ProjectName: IPGuard-boot
 * @PackageName: com.ellwood.IPGuard.common.core.exception
 * @ClassName: SystemException
 * @Description: // 自定义系统异常
 * @Author: Ellwood
 * @CreateDate: 2024/9/30 - 下午5:26
 * @Version: V1.0.0
 */
@Schema(description = "系统异常")
@Getter
@EqualsAndHashCode(callSuper = true)
public class SystemException extends RuntimeException {
        
        @Schema(description = "异常状态码")
        private Integer code;
        
        @Schema(description = "异常信息")
        private String msg;
        
        public SystemException(HttpCodeEnum httpCodeEnum) {
                super(httpCodeEnum.getMsg());
                
                this.code = httpCodeEnum.getCode();
                this.msg = httpCodeEnum.getMsg();
                
        }
        
}
